<?php
/**
 * 后台网站参数表操作模型
 * @author lifw
 */
class MSiteConfig extends MY_Model {

	protected $table = 'site_config';
	private $filter = array();

    function __construct() {
        parent::__construct();
    }

   
	public function saveConfig($defs){
		$data = Array();
		foreach ($defs as $def){
			$tmp['config_key'] = $def->config_key;
			$tmp['value'] = $def->value;
			$data[] = $tmp;
		}
		$this->db->empty_table($this->table);
		if($data){
			return $this->db->insert_batch($this->table, $data);
		}else{
			return true;
		}
	}
     
}
